home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2001 April
/
PCWorld_2001-04_cd.bin
/
Komunik
/
mozilla
/
MacOS
/
MacMozillaInstaller-0.8.sea-2.bin
/
Mozilla Installer
/
Installer Modules
/
browser.xpi
/
install.js
Wrap
Text File
|
2001-02-15
|
4KB
|
84 lines
// this function verifies disk space in kilobytes
function verifyDiskSpace(dirPath, spaceRequired)
{
var spaceAvailable;
// Get the available disk space on the given path
spaceAvailable = fileGetDiskSpaceAvailable(dirPath);
// Convert the available disk space into kilobytes
spaceAvailable = parseInt(spaceAvailable / 1024);
// do the verification
if(spaceAvailable < spaceRequired)
{
logComment("Insufficient disk space: " + dirPath);
logComment(" required : " + spaceRequired + " K");
logComment(" available: " + spaceAvailable + " K");
return(false);
}
return(true);
}
var srDest = 18542;
var err = initInstall("Mozilla Seamonkey", "Browser", "5.0.0.2001021502");
logComment("initInstall: " + err);
var fProgram = getFolder("Program");
logComment("fProgram: " + fProgram);
if (verifyDiskSpace(fProgram, srDest))
{
err = addDirectory("Program",
"5.0.0.2001021502",
"viewer", // jar source folder
fProgram, // target folder
"", // target subdir
true ); // force flag
logComment("addDirectory() returned: " + err);
var cf = getFolder("Chrome");
registerChrome(CONTENT | DELAYED_CHROME, getFolder(cf,"toolkit.jar"),"content/global/");
registerChrome(CONTENT | DELAYED_CHROME, getFolder(cf,"comm.jar"),"content/communicator/");
registerChrome(CONTENT | DELAYED_CHROME, getFolder(cf,"comm.jar"),"content/editor/");
registerChrome(CONTENT | DELAYED_CHROME, getFolder(cf,"comm.jar"),"content/navigator/");
registerChrome(CONTENT | DELAYED_CHROME, getFolder(cf,"comm.jar"),"content/necko/");
registerChrome(SKIN | DELAYED_CHROME, getFolder(cf,"classic.jar"),"skin/classic/communicator/");
registerChrome(SKIN | DELAYED_CHROME, getFolder(cf,"classic.jar"),"skin/classic/editor/");
registerChrome(SKIN | DELAYED_CHROME, getFolder(cf,"classic.jar"),"skin/classic/global/");
registerChrome(SKIN | DELAYED_CHROME, getFolder(cf,"classic.jar"),"skin/classic/messenger/");
registerChrome(SKIN | DELAYED_CHROME, getFolder(cf,"classic.jar"),"skin/classic/navigator/");
// registerChrome(SKIN | DELAYED_CHROME, getFolder(cf,"blue.jar"),"skin/blue/communicator/");
// registerChrome(SKIN | DELAYED_CHROME, getFolder(cf,"blue.jar"),"skin/blue/editor/");
// registerChrome(SKIN | DELAYED_CHROME, getFolder(cf,"blue.jar"),"skin/blue/global/");
// registerChrome(SKIN | DELAYED_CHROME, getFolder(cf,"blue.jar"),"skin/blue/messenger/");
// registerChrome(SKIN | DELAYED_CHROME, getFolder(cf,"blue.jar"),"skin/blue/navigator/");
registerChrome(SKIN | DELAYED_CHROME, getFolder(cf,"modern.jar"),"skin/modern/communicator/");
registerChrome(SKIN | DELAYED_CHROME, getFolder(cf,"modern.jar"),"skin/modern/editor/");
registerChrome(SKIN | DELAYED_CHROME, getFolder(cf,"modern.jar"),"skin/modern/global/");
registerChrome(SKIN | DELAYED_CHROME, getFolder(cf,"modern.jar"),"skin/modern/messenger/");
registerChrome(SKIN | DELAYED_CHROME, getFolder(cf,"modern.jar"),"skin/modern/navigator/");
// make an alias to the browser on the desktop
var desktopFolder = getFolder("Mac Desktop");
var ignoreErr = fileMacAlias(fProgram, "Mozilla", // source
desktopFolder, "Mozilla"); // target
logComment("fileMacAlias() returned: " + ignoreErr);
if (err==SUCCESS)
{
err = performInstall();
logComment("performInstall() returned: " + err);
}
else
{
cancelInstall(err);
logComment("cancelInstall() due to error: " + err);
}
}
else
cancelInstall(INSUFFICIENT_DISK_SPACE);